import {LOGIN_TOKEN, GET_USER_INFO} from "./types"
import { handleActions } from "redux-actions"

const defaultState = null

export const token = handleActions(
    {
        [LOGIN_TOKEN]: (state, { payload }) => {
            return { ...state, ...payload }
        }
    },
    defaultState
)
export const userInfo = handleActions(
    {
        [GET_USER_INFO]: (state, { payload }) => {
            return { ...state, ...payload }
        }
    }, defaultState
)
